package org.jfinanceobserver.persistence.jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * This is the QuoteProperty Entity
 *
 * $Author: r78v10a07@gmail.com $ $LastChangedDate: 2013-02-11 13:03:43 +0000 (Mon, 11 Feb 2013) $ $LastChangedRevision: 2 $
 *
 * @since Feb 10, 2013
 */
@Entity
@Table(name = "QuoteProperty")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "QuoteProperty.findAll", query = "SELECT q FROM QuoteProperty q"),
    @NamedQuery(name = "QuoteProperty.findById", query = "SELECT q FROM QuoteProperty q WHERE q.id = :id"),
    @NamedQuery(name = "QuoteProperty.findByName", query = "SELECT q FROM QuoteProperty q WHERE q.name = :name"),
    @NamedQuery(name = "QuoteProperty.findByTag", query = "SELECT q FROM QuoteProperty q WHERE q.tag = :tag"),
    @NamedQuery(name = "QuoteProperty.findByActive", query = "SELECT q FROM QuoteProperty q WHERE q.active = :active ORDER BY q.id")})
public class QuoteProperty implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Basic(optional = false)
    @Lob
    @Column(name = "Description")
    private String description;
    @Basic(optional = false)
    @Column(name = "Tag")
    private String tag;
    @Basic(optional = false)
    @Column(name = "Active")
    private boolean active;

    public QuoteProperty() {
    }

    public QuoteProperty(Integer id) {
        this.id = id;
    }

    public QuoteProperty(Integer id, String name, String description, String tag, boolean active) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.tag = tag;
        this.active = active;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public boolean getActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof QuoteProperty)) {
            return false;
        }
        QuoteProperty other = (QuoteProperty) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "QuoteProperty{" + "id=" + id + ", name=" + name + ", description=" + description + ", tag=" + tag + ", active=" + active + '}';
    }
}
